using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class HomePanel : IUIBehavior
{

    public override void Init()
    {

    }

    public override void AddListener()
    {
        GetUIElement<Button>("btnPlay").onClick.AddListener(OnPlayButtonClick);
        GetUIElement<Button>("btnQuit").onClick.AddListener(OnQuitButtonClick);
    }

    public override void RemoveListener()
    {
        GetUIElement<Button>("btnPlay").onClick.RemoveListener(OnPlayButtonClick);
        GetUIElement<Button>("btnQuit").onClick.RemoveListener(OnQuitButtonClick);

    }

    public void OnPlayButtonClick()
    {
        
        PanelManager.Instance.ShowPanel(typeof(GamePanel).Name);
    }

    public void OnQuitButtonClick()
    {
        Application.Quit();
    }
}
